package com.itmk.system.role.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itmk.system.role.entity.Role;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.FetchType;

import java.util.List;

public interface RoleMapper extends BaseMapper<Role> {

    @Select("select ur.role_id as id, " +
            "r.name as name, " +
            "r.remark as remark, " +
            "r.status as status, " +
            "r.deleted as deleted" +
            " from  user_role ur left join role r on ur.role_id = r.id " +
            "where  ur.user_id = #{userId}")

    List<Role> findRoleListByUserId(@Param("userId")Long userId);
}
